package com.cuixichang.minimalism.basal.core;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;

@ApiModel(value = "基础响应封装对象")
@Data
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
public class BaseVO implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @ApiModelProperty(value = "主键ID", name = "id")
    @JsonSerialize(using= ToStringSerializer.class)
    private Long id;

    /**
     * 启用状态【0:弃用;1:启用(默认)】
     * @see com.cuixichang.minimalism.basal.enums.IsEnableEnum
     */
    @ApiModelProperty(value = "启用状态【0:弃用;1:启用(默认)】", name = "isEnable", allowableValues = "0,1")
    private Boolean isEnable;

    /**
     * 数据排序
     */
    @ApiModelProperty(value = "数据排序", name = "sort")
    private Integer sort;

    /**
     * 数据更新时间
     */
    @ApiModelProperty(value = "数据更新时间", name = "updateTime")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    @DateTimeFormat(iso=DateTimeFormat.ISO.DATE_TIME)
    private LocalDateTime updateTime;

    /**
     * 创建数据用户使用的登录id
     */
//    @ApiModelProperty(value = "创建数据用户ID", name = "createLoginId")
//    @JsonSerialize(using= ToStringSerializer.class)
//    private Long createLoginId;

    /**
     * 创建数据用户名
     */
//    @ApiModelProperty(value = "创建数据用户名", name = "createLoginName")
//    private String createLoginName;

    /**
     * 更新数据用户使用的登录id
     */
//    @ApiModelProperty(value = "更新数据用户ID", name = "updateLoginId")
//    @JsonSerialize(using= ToStringSerializer.class)
//    private Long updateLoginId;

    /**
     * 更新数据用户名
     */
//    @ApiModelProperty(value = "更新数据用户名", name = "updateLoginName")
//    private String updateLoginName;
}
